88A - Chord - CodeForces Solution


brute force implementation *1200

Please click on ads to support us..

Python Code:

import itertools as it
lst = 'C,C
out = [0,0,0,0,0,0]
n = input().split(' ')
per = list(it.permutations(n))
for i in per:
    x = lst.index(i[0])
    y = lst.index(i[1])
    z = lst.index(i[2])
        xy = 0
    yz = 0
    if y < x:
        xy = y + 12 - x
    else: 
        xy = y - x

    if z < y:
        yz = z + 12 - y
    else :
        yz = z - y
        if (xy == 4 and yz == 3):
        out.append('major')
    elif (xy == 3 and yz == 4):
        out.append('minor')

flag = True
for i in out:
    if i == 'major' or i == 'minor':
        print(i)
        flag = False
        break
   

if flag:
    print('strange')


Comments

Submit
0 Comments
More Questions

766A - Mahmoud and Longest Uncommon Subsequence
701B - Cells Not Under Attack
702A - Maximum Increase
1656D - K-good
1426A - Floor Number
876A - Trip For Meal
1326B - Maximums
1635C - Differential Sorting
961A - Tetris
1635B - Avoid Local Maximums
20A - BerOS file system
1637A - Sorting Parts
509A - Maximum in Table
1647C - Madoka and Childish Pranks
689B - Mike and Shortcuts
379B - New Year Present
1498A - GCD Sum
1277C - As Simple as One and Two
1301A - Three Strings
460A - Vasya and Socks
1624C - Division by Two and Permutation
1288A - Deadline
1617A - Forbidden Subsequence
914A - Perfect Squares
873D - Merge Sort
1251A - Broken Keyboard
463B - Caisa and Pylons
584A - Olesya and Rodion
799A - Carrot Cakes
1569B - Chess Tournament